
<form id="add-form" class="form-horizontal col-sm-12" role="form" data-toggle="validator" method="POST" action="">
	{:token()}
	<input type="hidden" name="row[id]" value="{$row.id}">
	<div class="form-group">
		<div class="col-xs-12 col-sm-6">
			<div class="form-group col-sm-10">
				<label for="c-consignee">收货人:</label>
				<input id="c-consignee" data-rule="required" class="form-control" placeholder="收货人" name="row[consignee]"  type="text" value="{$row.consignee}" >
			</div>
		</div>
		<div class="col-xs-12 col-sm-6">
			<div class="form-group col-sm-10">
				<label for="c-consignee_mobile">联系方式:</label>
				<input id="c-consignee_mobile" data-rule="required" class="form-control" placeholder="收货人" name="row[consignee_mobile]"  type="text" value="{$row.consignee_mobile}">
			</div>
		</div>
		<div class="col-xs-12 col-sm-6">
			<div class="form-group col-sm-10">
				<label for="c-address">收货地址:</label>
				<input id="c-address" class="form-control" data-toggle="city-picker" name="row[address]" type="text"  value="{$row.address}" />
			</div>
		</div>
		<div class="col-xs-12 col-sm-6">
			<div class="form-group col-sm-10">
				<label>详细地址:</label>
				<textarea class="form-control" rows="3" name="row[address_detail]" placeholder="详细地址">{$row.address_detail}</textarea>
			</div>
		</div>
		<div class="col-xs-12 col-sm-6">
			<div class="form-group col-sm-10">
				<label>要求交货时间:</label>
				<input data-rule="required" class="form-control datetimepicker" data-date-format="YYYY-MM-DD" data-use-current="true" placeholder="要求交货时间" name="row[actual_delivery_time]" value="{$row.actual_delivery_time}" type="text">
			</div>
		</div>
		<div class="col-xs-12 col-sm-6">
			<div class="form-group col-sm-10">
				<label for="c-actual_delivery_time">实际交货时间:</label>
				<input id="c-actual_delivery_time" data-rule="required" class="form-control datetimepicker" data-date-format="YYYY-MM-DD" data-use-current="true" placeholder="实际交货时间" name="row[actual_delivery_time]" value="{$row.actual_delivery_time}" type="text">
			</div>
		</div>
		<div class="col-xs-12 col-sm-6">
			<div class="form-group col-sm-10">
				<label >是否需要安装:</label>
				{:build_radios('row[is_install]', ['0'=>'否', '1'=>'是'],$row['is_install'])}

			</div>
		</div>
		<div class="col-xs-12 col-sm-12">
			<div class="form-group col-sm-12">
				<dl class="fieldlist" data-name="row[product]" data-template="testtpl">
					<dd>
						<label>产品信息:</label>
					</dd>
					<textarea name="row[product]" class="form-control hide" cols="30" rows="5">{$row.customer_product}</textarea>
				</dl>
			</div>
		</div>

		<div class="col-xs-12 col-sm-6">
			<div class="form-group col-sm-10">
				<label>备注（特殊要求）:</label>
				<textarea class="form-control" rows="3" name="row[remarks]" placeholder="请填写备注">{$row.remarks}</textarea>
			</div>
		</div>

	</div>

	<div class="form-group layer-footer">
		<label class="control-label col-xs-12 col-sm-2"></label>
		<div class="col-xs-12 col-sm-8">
			<button type="submit" class="btn btn-success btn-embossed disabled">{:__('OK')}</button>
			<button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
		</div>
	</div>
</form>

<!--定义模板-->
<script type="text/html" id="testtpl">
	<dd>
		<div class="form-inline" style="margin-bottom:20px;display: flex;">
			<input type="hidden" name="row[<%=name%>][<%=index%>][id]" class="form-control" value="<%=row['id']%>"
				   size="30">
			<span>产品名称:<input type="text" data-source="qingdongams/common/getProduct"
							  class="form-control selectpage" name="row[<%=name%>][<%=index%>][product_id]"
							  data-field="name" data-primary-key="id" style="width: 200px;"
							  value="<%=row['product_id']%>"/></span>
			<span>产品编号:<input type="text"  class="form-control" name="row[<%=name%>][<%=index%>][number]" placeholder="请填写产品编号，多个用逗号分隔"
							value="<%=row['number']%>"/></span>

			<div class="col-xs-12 col-sm-10">
				<div class="form-group col-sm-10">
					<label>附件:</label>
					<div class="input-group">
						<input id="c-files<%=index%>" class="form-control" size="50" name="row[<%=name%>][<%=index%>][file_ids]" type="text" value="<%=row['file_ids']%>">
						<div class="input-group-addon no-border no-padding">
                        <span><button type="button" id="plupload-avatar" class="btn btn-danger plupload"
									  data-input-id="c-files<%=index%>"
									  data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp"
									  data-multiple="true" data-preview-id="p-collection_img<%=index%>"
									  data-url="qingdongams/base/upload"><i class="fa fa-upload"></i> 上传</button></span>

						</div>
						<span class="msg-box n-right" for="c-files<%=index%>"></span>
					</div>
					<ul class="row list-inline plupload-preview" id="p-collection_img<%=index%>"></ul>
				</div>
			</div>
		</div>
	</dd>
</script>